<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <script src="https://cdn.jsdelivr.net/npm/vue@2.6.10/dist/vue.js"></script>
    <title>Document</title>
    <style>
        .one{
            width: 100px;
            height: 100px;
            background-color: navy;
        }
        .two{
            width: 200px;
            height: 200px;
            background-color: hotpink;
        }
        .three{
            width: 300px;
            height: 300px;
            background-color: yellowgreen;
        }
    </style>
</head>
<body>
    <div id="app">
        <!-- class属性, 值是字符串       -->
        <div :class="className1"></div>
        <br/>
        <!-- class属性, 值是对象       -->
        <div :class = 'className2'></div>
        <br/>
        <!-- class属性, 值是数组1       -->
        <div :class = 'className3'></div>
        <br/>
        <!-- class属性, 值是数组2       -->
        <div :class = "['one','two','three']"></div>
        <br/>
        <!-- 判断是否拥有某属性       -->
        <div :class = "className2.three?'one':''"></div>
        <br/>


        <!-- style对象的写法       -->
        <div :style = {fontSize:'50px',fontStyle:'italic'}>1</div>
        <br/>
        <!-- style属性， 值是对象       -->
        <div :style = 'boxStyle'>2</div>
        <br/>
        <!-- style属性， 值是数组1       -->
        <div :style = ['style1','style2','style3']>3</div>
        <br/>
        <!-- style属性， 值是数组2       -->
        <div :style = ['style1','style2']>4</div>
    </div>
    <script>
        const vm = new Vue({
            el:'#app',
            data(){
                return{
                    className1:'one',
                    className2:{
                        one: true,
                        two: true,
                        three: true
                    },
                    className3:['one','two','three'],
                    boxStyle: {
                        color: '#bfc',
                        fontSize: '60px',
                        textStyle: 'italic'
                    },
                    Style1: {
                        color: 'skyblue',
                    } ,
                    Style2: {
                        fontWeight:'bold'
                    } ,
                    Style3: {
                        fontStyle: 'italic'
                    } ,
                }
            }
        })
    </script>
</body>
</html>